//
//  PronmotionItemView.m
//  TerritoryShopkeeper
//
//  Created by xiaowu on 2017/12/13.
//  Copyright © 2017年 ZDQK. All rights reserved.
//

#import "PronmotionItemView.h"

@interface PronmotionItemView ()

@property (nonatomic, strong) UILabel *label;
@property (nonatomic, strong) UILabel *descriptionLabel;

@end

@implementation PronmotionItemView

- (instancetype)init {
    self = [super init];
    if (self) {
        [self configureUI];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.label.frame = CGRectMake(0, 3, 24, 14);
    [self.label setCircleWithColor:[UIColor redF2color] borderWidth:1.0 cornerRadius:2.0];
    self.descriptionLabel.frame = CGRectMake(self.label.right + 10, 0, self.width - self.label.width - 10, 20);
}

#pragma mark - Method
- (void)configureUI {
    [self addSubview:self.label];
    [self addSubview:self.descriptionLabel];
    
}

- (void)setValueForView:(PromotionModel *)model {
    self.label.text = model.label;
    self.descriptionLabel.text = model.labelInfo;
}


#pragma mark - Getters
- (UILabel *)label {
    if (!_label) {
        _label = [[UILabel alloc] init];
        _label.font = TextPingFangFontSize(10);
        _label.textColor = [UIColor redF2color];
        _label.backgroundColor = [UIColor whiteColor];
        _label.textAlignment = NSTextAlignmentCenter;
    }
    return _label;
}

- (UILabel *)descriptionLabel {
    if (!_descriptionLabel) {
        _descriptionLabel = [[UILabel alloc] init];
        _descriptionLabel.font = TextPingFangFontSize(14);
        _descriptionLabel.textColor = [UIColor blackTextColor];
    }
    return _descriptionLabel;
}

@end
